package task;

import java.util.Scanner;

public class task6 {
    public static void main(String[] args) {
        //从键盘输入3个数（其中一个数用来代表加减乘除的符号，其余两个数用来计算），用来进行加/减/乘/除/取余
        System.out.println("请任意输入2个数字");
        Scanner input=new Scanner(System.in);
        int num1=input.nextInt();
        int num2=input.nextInt();
        System.out.println("请输入+，-，*，/,%其中一种关系运算符");
        char c=input.next().charAt(0);
        switch(c)
        {
            case '+':
                System.out.println(num1+"+"+num2+"="+(num1+num2));
                break;
            case '-':
                System.out.println(num1+"-"+num2+"="+(num1-num2));
                break;
            case '*':
                System.out.println(num1+"*"+num2+"="+(num1*num2));
                break;
            case '/':
                System.out.println(num1+"/"+num2+"="+(num1/num2));
                break;
            case'%':
                System.out.println(num1+"%"+num2+"="+(num1%num2));
            default:
                System.out.println("非法运算符");
                break;
        }
    }
}
